#include <iostream>
#include "../../common/person.h"

bool greater(double first, double second)
{
    return first > second;
}
auto greater_curried(double first)
{
    return [first](double second) {
        return first > second;
    };
}
void print_person(const person_t &person,
                  std::ostream &out,
                  person_t::output_format_t format)
{
    if (format == person_t::name_only) {
        out << person.name() << '\n';

    } else if (format == person_t::full_name) {
        out << person.name() << ' '
            << person.surname() << '\n';

    }
}

auto print_person_cd(const person_t &person)
{
    return [&](std :: ostream & out) {
        return [&](person_t::output_format_t format) {
            print_person(person,out,format);
        };
    };
}
int main(int argc, char *argv[])
{
    std::cout<<greater(2, 3) << "\n";
    std::cout<<greater_curried(2)(3) << "\n";
    person_t person("zhang", person_t::gender_t::female);
    print_person(person,std::cout,person_t::name_only);
    print_person_cd(person)(std::cout)(person_t::name_only);
    
    return 0;
}